import request from '@/utils/request.js'

// 商品列表
export function goodsList(data) {
    return request({
        url: '/njnzzs/merchant/goods',
        method: 'GET',
        data
    })
}

// 商品类目
export function goodsCategories(data = {}) {
    return request({
        url: '/njnzzs/goodsCategories',
        method: 'GET',
        data
    })
}

// 按商品统计
export function goodsSummary(data) {
    return request({
        url: '/njnzzs/merchant/goods/summary',
        method: 'GET',
        data
    })
}

// 启用商品
export function goodsDisabled(data) {
    return request({
        url: '/njnzzs/merchant/goods/updateGoodsDisable',
        method: 'POST',
        data
    })
}

// 添加商品
export function addGoods(data) {
    return request({
        url: '/njnzzs/merchant/goods',
        method: 'POST',
        data
    })
}

// 设置库存
export function setGoodsStock(data) {
    return request({
        url: '/njnzzs/merchant/goods/stock',
        method: 'POST',
        data
    })
}

// 设置库存
export function goodsInfo(id) {
    return request({
        url: `/njnzzs/merchant/goods/detail/${id}`,
        method: 'GET'
    })
}